<!--
*Author：富行天下团队
 *
 *代码由框架生成,   
 *业务请在@/extension/mall/Mall_accounts.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table" 
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/mall/Mall_accounts.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
import TreeTable1Vue from "../treeTable/TreeTable1.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '应收账户',
                    name: 'Mall_accounts',
                    url: "/Accounts/",
                    sortName: "createDate"
                },
                extend: extend,
                editFormFields: {"accountsReceivableCode":"","accountsReceivable":"","modifyDate":"","createDate":"","modifyID":"","createID":"","financeRemark":"","signType":"","accountBalance":"","modifier":"","creator":"","isAvailable":"","isDeactivate":"","isIncome":"","effectiveEndDate":"","effectiveStartDate":"","warnPhone":"","contactPhone":"","contactPerson":"","warnLimit":"","temporaryLimit":"","accountLimit":"","total":"","isCredit":"","creditTotal":"0"},
                editFormOptions: [
                                 [{"title":"应收账名称","required":true,"field":"accountsReceivable","type":"text"},
                                 {"title":"应收账编码","required":true,"field":"accountsReceivableCode","type":"text",hidden:true},
                                 {"title":"签单类型","required":true,"field":"signType","type":"select","dataKey":"signType"},
                                 {"title":"是否入账","required":true,"field":"isIncome","type":"switch"},
                                 ],
                                [//{"title":"账户余额","field":"accountBalance","type":"decimal"},
                                {"title":"借方合计","field":"total","type":"decimal"},
                                {"title":"是否授信","field":"isCredit","type":"switch"},
                                {"title":"授信额度","required":true,"field":"creditTotal","type":"decimal"},
                                {"title":"是否自动停用","required":true,"field":"isDeactivate","type":"switch"},],
                                [{"title":"单笔挂账限额","required":true,"field":"accountLimit","type":"text"},
                                 {"title":"临时限额","required":true,"field":"temporaryLimit","type":"decimal"},
                                 {"title":"警告手机","required":true,"field":"warnPhone","type":"phone"},
                                 {"title":"警告限额","required":true,"field":"warnLimit","type":"decimal"},],
                                [{"title":"联系人","required":true,"field":"contactPerson","type":"text"},
                                 {"title":"联系人电话","required":true,"field":"contactPhone","type":"phone"},
                                 {"title":"是否可用","required":true,"field":"isAvailable","type":"switch"}],
                                 [{"title":"有效开始时间","required":true,"field":"effectiveStartDate","type":"date"},
                                 {"title":"有效结束时间","required":true,"field":"effectiveEndDate","type":"date"},
                                 ],
                                 [{"title":"财务备注","field":"financeRemark","type":"financeRemark",colSize: 12}],
                                 [{"title":"备注","field":"remark","type":"textarea",colSize: 12},],
                                 ],
                searchFormFields: {"accountsReceivable":"","contactPerson":"","signType":"","effectiveStartDate":"","effectiveEndDate":"","isCredit":""},
                searchFormOptions: [[{"title":"应收账户","field":"accountsReceivable","type":"like"},{"title":"联系人","field":"contactPerson","type":"like"},{"title":"签单类型","field":"signType","type":"select","dataKey":"signType"}],[{ "title": "有效开始时间", "field": "effectiveStartDate", "type": "datetime" },{ "dataKey": "enable", "data": [], "title": "是否授信", "field": "isCredit", "type": "select" }]],
                columns: [{field:'id',title:'主键',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'accountsReceivable',title:'应收账户名称',type:'string',width:120,align:'left',sortable:true},
                       {field:'accountBalance',title:'账户余额',type:'decimal',width:90,align:'left'},
                       {field:'signType',title:'签单类型',bind: { key: 'signType', data: [] },type:'string',width:120,align:'left'},
                       {field:'temporaryLimit',title:'临时限额',type:'decimal',width:120,align:'left'},
                       {field:'accountLimit',title:'单笔挂账限额',type:'decimal',width:120,align:'left'},
                      // {field:'isAvailable',title:'是否可用',bind: { key: 'enable', data: [] },type:'int',width:90,align:'left'},
                       {field:'effectiveStartDate',title:'有效开始时间',type:'datetime',width:160,align:'left',sortable:true},
                       {field:'effectiveEndDate',title:'有效结束时间',type:'datetime',width:160,align:'left',sortable:true},
                       {field:'total',title:'借方合同',type:'decimal',width:120,align:'left'},
                       {field:'isCredit',title:'是否授信',bind: { key: 'enable', data: [] },type:'int',width:120,align:'left'},
                       {field:'creditTotal',title:'授信额度',type:'decimal',width:120,align:'left'},
                       {field:'contactPerson',title:'联系人',type:'string',width:120,align:'left'},
                       {field:'contactPhone',title:'联系人电话',type:'phone',width:120,align:'left'},
                       {field:'warnLimit',title:'警告限额',type:'decimal',width:120,align:'left'},
                       {field:'warnPhone',title:'警告手机',type:'string',width:120,align:'left'},
                        {field:'isDeactivate',title:'是否自动停用',bind: { key: 'enable', data: [] },type:'int',width:120,align:'left'},
                       {field:'isIncome',title:'是否入账',bind: { key: 'enable', data: [] },type:'int',width:120,align:'left'},
                       {field:'financeRemark',title:'财务备注',type:'string',width:120,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:120,align:'left'},
                       {field:'modifier',title:'修改人',type:'string',width:180,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',width:135,align:'left',sortable:true},
                      // {field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
                       {field:'createDate',title:'创建时间',type:'datetime',width:135,align:'left',sortable:true},
                      // {field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
                       {field:'creator',title:'创建人',type:'string',width:180,align:'left'},
                    //    {field:'spare14',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare15',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare1',title:'扩展字段1',type:'string',width:220,align:'left'},
                    //    {field:'spare2',title:'扩展字段1',type:'string',width:220,align:'left'},
                    //    {field:'spare3',title:'扩展字段1',type:'string',width:220,align:'left'},
                    //    {field:'spare4',title:'扩展字段1',type:'string',width:220,align:'left'},
                    //    {field:'spare5',title:'扩展字段1',type:'string',width:220,align:'left'},
                    //    {field:'spare13',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare12',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare11',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare10',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare9',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare8',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare7',title:'扩展字段1',type:'string',width:120,align:'left'},
                    //    {field:'spare6',title:'扩展字段1',type:'string',width:120,align:'left'}
                    ],
                detail: {
                    cnName:"#detailCnName",
                    columns: [],
                    sortName: "",
                    key:""
                }
            };
        }
    };
    export default vueParam;
</script>
